package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.business.domain.BusCustomerDetail;
import com.ruoyi.business.domain.BusCustomerParam;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusCustomerMapper;
import com.ruoyi.business.domain.BusCustomer;
import com.ruoyi.business.service.IBusCustomerService;

/**
 * 客户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class BusCustomerServiceImpl implements IBusCustomerService 
{
    @Autowired
    private BusCustomerMapper busCustomerMapper;

    /**
     * 查询客户信息
     * 
     * @param customerId 客户信息主键
     * @return 客户信息
     */
    @Override
    public BusCustomer selectBusCustomerByCustomerId(Long customerId)
    {
        return busCustomerMapper.selectBusCustomerByCustomerId(customerId);
    }

    /**
     * 查询客户信息列表
     * 
     * @param busCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<BusCustomer> selectBusCustomerList(BusCustomer busCustomer)
    {
        return busCustomerMapper.selectBusCustomerList(busCustomer);
    }

    /**
     * 新增客户信息
     * 
     * @param busCustomer 客户信息
     * @return 结果
     */
    @Override
    public int insertBusCustomer(BusCustomer busCustomer)
    {
        busCustomer.setCreateTime(DateUtils.getNowDate());
        return busCustomerMapper.insertBusCustomer(busCustomer);
    }

    /**
     * 修改客户信息
     * 
     * @param busCustomer 客户信息
     * @return 结果
     */
    @Override
    public int updateBusCustomer(BusCustomer busCustomer)
    {
        busCustomer.setUpdateTime(DateUtils.getNowDate());
        return busCustomerMapper.updateBusCustomer(busCustomer);
    }

    /**
     * 批量删除客户信息
     * 
     * @param customerIds 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteBusCustomerByCustomerIds(Long[] customerIds)
    {
        return busCustomerMapper.deleteBusCustomerByCustomerIds(customerIds);
    }

    /**
     * 删除客户信息信息
     * 
     * @param customerId 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteBusCustomerByCustomerId(Long customerId)
    {
        return busCustomerMapper.deleteBusCustomerByCustomerId(customerId);
    }

    @Override
    public List<BusCustomerDetail> getCustomerDetail(BusCustomerParam busCustomerParam){
        return busCustomerMapper.getCustomerDetail(busCustomerParam);
    }
}
